package com.link2room.optimus.entity;

import com.link2room.common.entity.BaseEntity;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * Created by sss on 2016/9/28.
 */
@Entity
@Table(name = "price_base", catalog = "")
@DynamicInsert
public class PriceBase extends BaseEntity{
    public enum PriceBase_{
        priceCode,name
    }

    /**
     * 基价代码
     */
    private String priceCode;
    /**
     * 基价名称
     */
    private String name;

    @Basic
    @Column(name = "price_code", nullable = false, length = 32)
    public String getPriceCode() {
        return priceCode;
    }

    public void setPriceCode(String priceCode) {
        this.priceCode = priceCode;
    }

    @Basic
    @Column(name = "name", nullable = false, length = 32)
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        PriceBase priceBase = (PriceBase) o;

        if (priceCode != null ? !priceCode.equals(priceBase.priceCode) : priceBase.priceCode != null) return false;
        if (name != null ? !name.equals(priceBase.name) : priceBase.name != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = priceCode != null ? priceCode.hashCode() : 0;
        result = 31 * result + (name != null ? name.hashCode() : 0);
        return result;
    }
}
